﻿using DingVision.Axis.ViewModels.Dialogs;
using DingVision.Axis.Views;
using DingVision.Axis.Views.Dialogs;
using Prism.Ioc;
using Prism.Modularity;
using Prism.Regions;

namespace DingVision.Axis
{
    public class AxisModule : IModule
    {
        public void OnInitialized(IContainerProvider containerProvider)
        {
            var regionManager = containerProvider.Resolve<IRegionManager>();
            regionManager.RegisterViewWithRegion("ContentRegion", typeof(AxisPage));
            regionManager.RegisterViewWithRegion("ContentRegion2", typeof(CurrentPos));
            regionManager.RegisterViewWithRegion("AxisContentRegion", typeof(JogPage));
            regionManager.RegisterViewWithRegion("AxisContentRegion", typeof(PointPage));
            regionManager.RegisterViewWithRegion("AxisContentRegion", typeof(IOPage));
        }

        public void RegisterTypes(IContainerRegistry containerRegistry)
        {
            //注册对话框
            containerRegistry.RegisterDialog<TeachPointDialog, TeachPointDialogViewModel>();
            containerRegistry.RegisterDialog<MovePointDialog, MovePointDialogViewModel>();
        }
    }
}